package pikes.samples.countries.ui.peak;

import java.util.Map;

import org.springframework.web.servlet.support.RequestContext;

import pikes.ecma.ScriptURI;
import pikes.ecma.SourceElement;
import pikes.peak.RequestProperty;
import pikes.uri.URI;

public class EventHandlerURI implements RequestProperty<URI> {

	private RequestProperty<SourceElement> eventHandler = null;

	public EventHandlerURI(RequestProperty<SourceElement> eventHandler) {
		super();
		this.eventHandler = eventHandler;
	}

	public URI getValue(Map model, RequestContext requestContext) throws Exception {
		return new ScriptURI(eventHandler.getValue(model, requestContext));
	}

}